/*
* Copyright (c) 2007 by Kirill Kolodyazhniy.
* See the file "license.terms" for information on usage and redistribution.
*/

#ifndef M_DXINDEXBUFFER_H
#define M_DXINDEXBUFFER_H

#include "hardwarebuffer.h"
#include "comptr.h"

#include "dxheaders.h"

namespace Engine
{
	/**
	*   DirectX index buffer.
	*/
	class DXIndexBuffer: public HardWareBuffer
	{
	public:
		DXIndexBuffer(IDirect3DIndexBuffer9* indexBuffer);

		~DXIndexBuffer();

		virtual void* Lock();

		virtual const void* Lock() const;

		virtual void UnLock() const;

		IDirect3DIndexBuffer9* GetBuffer();

	private:

		mutable ComPtr<IDirect3DIndexBuffer9> m_indexBuffer;

	};
}

#endif

